package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.entity.Approve;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.ApproveListFragment;
import com.wwtech.epp.ui.activity.work.contract.ApproveListContract;
import com.wwtech.epp.ui.activity.work.presenter.ApproveListPresenter;
import com.wwtech.epp.ui.adapter.work.ApproveListAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of ApproveListFragment, provide field for ApproveListFragment
 * @date 2017/09/16 23:03:27
 */
@Module
public class ApproveListModule {
    private final ApproveListContract.View mView;


    public ApproveListModule(ApproveListContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public ApproveListPresenter provideApproveListPresenter(HttpAPIWrapper httpAPIWrapper, ApproveListFragment mFragment) {
        return new ApproveListPresenter(httpAPIWrapper, mView, mFragment);
    }

    @Provides
    @ActivityScope
    public ApproveListFragment provideApproveListFragment() {
        return (ApproveListFragment) mView;
    }


    @Provides
    @ActivityScope
    public ApproveListAdapter provideApproveListAdapter() {
        return new ApproveListAdapter(new ArrayList<Approve.DataBean.ListBean>());
    }
}